import CreepControlLoopObject from "@/app/creep/lo";
import SpawnControlLoopObject from "@/app/spawn/lo";
import { Entrypoint, errorMapper } from "@/contrib";
import { mountList } from '@/app'
import MainControlLoopObject from "@/app/main";
import StatsControlLoopObject from "./app/stats";
import GeneratePixelControlLoopObject from "./app/pixel";
import RoomControlLoopObject from "./app/room/lo";
import StructureControlLoopObject from "./app/structures/lo";

const entrypoint: Entrypoint = new Entrypoint({ mountList });

// 使用 sourceMap 校正报错信息
entrypoint.catcher = errorMapper

//
entrypoint.register(new MainControlLoopObject('MainControllLoopObject'))

//
entrypoint.register(new SpawnControlLoopObject('SpawnControlLoopObject'))

//
entrypoint.register(new RoomControlLoopObject('RoomControlLoopObject'))

//
entrypoint.register(new StructureControlLoopObject('StructureControlLoopObject'))

//
entrypoint.register(new CreepControlLoopObject('CreepControlLoopObject'))

//
// PowerCreep

//
entrypoint.register(new StatsControlLoopObject('StatsControlLoopObject'))

//
entrypoint.register(new GeneratePixelControlLoopObject('GeneratePixelControlLoopObject'))

// 运行 bot
export const loop = () => entrypoint.loop()
